var e = getApp();

Page({
    data: {
        active: 0,
        refundId: null,
        refundDetail: {},
        steps: []
    },
    onLoad: function(e) {
        var t;
        "" !== (null !== (t = e.refundId) && void 0 !== t ? t : "") && (this.setData({
            refundId: Number(e.refundId)
        }), this.refundDetail());
    },
    onReady: function() {},
    refundDetail: function() {
        var t = this, n = e.getNetAddresss("refund.detail"), a = {
            refund_id: this.data.refundId
        };
        e._getNetWork({
            url: n,
            data: a,
            success: function(e) {
                var n = e.data;
                if (1 == n.result) {
                    var a = n.data, o = [], s = 0;
                    a.create_time && (o.push({
                        text: "申请退款",
                        desc: a.create_time
                    }), o.push({
                        text: "退款成功",
                        desc: ""
                    })), a.refund_time && (o[1].desc = a.refund_time, s = 1), a.reject_time && (o[1].text = "申请驳回", 
                    o[1].desc = a.reject_time, s = 1), t.setData({
                        refundDetail: a,
                        steps: o,
                        active: s
                    });
                } else wx.showToast({
                    icon: "none",
                    title: n.msg,
                    duration: 1500
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    copyCode: function(e) {
        var t = e.currentTarget.dataset.text;
        console.log(t), wx.setClipboardData({
            data: t,
            success: function(e) {
                wx.getClipboardData({
                    success: function(e) {
                        wx.showToast({
                            title: "复制成功"
                        });
                    }
                });
            }
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});